#!/usr/bin/env bash
# yitong.bai@qq.com

set -o errexit
set -o nounset
set -o pipefail
set -o xtrace

# Export ENVs
export WORKSPACE=$(dirname $(readlink -f $0))
export CONF_DIR="${WORKSPACE}/conf"
export DATA_DIR="${WORKSPACE}/data"
export LOG_DIR="${WORKSPACE}/log"
export LIB_DIR="${WORKSPACE}/gaea"
export ROLE_DIR="${WORKSPACE}/roles"

# Run Main Function
cd "${WORKSPACE}" || return 1
source ./roles/main.sh
main "$@"